The present invention relates to a decoder, and more particularly to a variable length decoder.
Many video applications utilize data compression. More particularly, many video applications utilize transform code compressed domain formats, which include the Discrete Cosine Transform (DCT) format, the interframe predictive code format, such as the Motion Compensation (MC) algorithm, and hybrid compressed formats. The combination of Motion Compensation and Discrete Cosine Transform is used in a number of protocol standards, including Moving Picture Expert Group (MPEG) standards MPEG-1, MPEG-2, MPEG-4, and International Telecommunication Union (ITU) standards H.261, and H.263.
Referring to FIG. 1, many standard video protocols (e.g. MPEG-1) use variable length coding. However, if variable length coding is used and one or more errors occur in the bit stream due to channel errors, all data between the resynchronization markers is usually discarded.
Referring to FIG. 2, in order to improve performance in an error-prone environment like wireless applications, reversible variable length code is used in some video protocols (e.g. MPEG-4) for coding DCT data. Since the reversible variable length code can be decoded in both directions, forward and reverse, it can be used to recover more DCT data from a corrupted bit stream. When a reversible variable length decoder meets errors in the forward direction, the reversible variable length decoder can jump to the next resynchronization marker and perform decoding in the reverse direction. Thus, comparing FIGS. 1 and 2, the reversible variable length decoder can recover some of the data (see FIG. 2) which would have been discarded if a non-reversible variable length decoder was used (see FIG. 1)